﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections;

namespace ch4_class
{
    class Program
    {
        static void Main(string[] args)
        {
            Cat cat1 = new Cat("Tom");
            Cat cat2 = new Cat("Mimi", 10, 2);
            Cat cat3 = new Cat("Jiafei", 8, 4);

            Hashtable ht = new Hashtable();
            ht.Add(cat1.getName(), cat1);
            ht.Add(cat2.getName(), cat2);
            ht.Add(cat3.getName(), cat3);

            Cat minCat = cat1;
            foreach(string name in ht.Keys)
            {
                if (((Cat)ht[name]).getWeight() < minCat.getWeight()) 
                    minCat = (Cat)ht[name];
            }
            minCat.showInformation();
            Console.Read();
        }
    }
}
